package cn.com.connext.scrm.repository.master;


import cn.com.connext.scrm.domain.master.MdmHelpFullCall;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;



@Repository
public interface MdmHelpFullCallRepository extends JpaRepository<MdmHelpFullCall, Long>, JpaSpecificationExecutor {

    MdmHelpFullCall findByCreateUnionIdAndMdmHelpActivityId(@Param("createUnionId") String createUnionId,@Param("mdmHelpActivityId") Long mdmHelpActivityId);

    @Modifying
    @Query("update MdmHelpFullCall set isCall = 2 where createUnionId = :createUnionId and mdmHelpActivityId = :mdmHelpActivityId ")
    void updateByCreateUnionIdAndMdmHelpActivityId(@Param("createUnionId")String createUnionId, @Param("mdmHelpActivityId")Long mdmHelpActivityId);

}
